package com.example.android_wx.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.example.android_wx.R;
import com.example.android_wx.http.CircleBean;
import com.luck.picture.lib.entity.LocalMedia;

import java.util.ArrayList;
import java.util.List;

public class CircleLikeAdapter extends RecyclerView.Adapter<CircleLikeAdapter.Holder> {

    private List<CircleBean.LikeDataDTO> arrayList;

    public CircleLikeAdapter(List<CircleBean.LikeDataDTO> arrayList) {
        this.arrayList = arrayList;
    }

    @NonNull
    @Override
    public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_circle_like, parent, false);
        return new Holder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull Holder holder, int position) {

        CircleBean.LikeDataDTO bean  = arrayList.get(position);
        holder.nameTextView.setText(bean.getMemberNickname());

            holder.heartTextView.setVisibility(View.VISIBLE);




    }

    @Override
    public int getItemCount() {
        return arrayList.size();
    }

    public static class Holder extends RecyclerView.ViewHolder {

        private AppCompatTextView nameTextView;
        private AppCompatTextView heartTextView;

        public Holder(@NonNull View view) {
            super(view);
            heartTextView = view.findViewById(R.id.heartTextView);
            nameTextView = view.findViewById(R.id.nameTextView);
        }

    }

}
